import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 38917
 * Date: 2025-02-27
 * Time: 21:51
 */
public class FactorialSum {
    //求1！+2！+3！+4！+........+n!的和
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int sum = 0;
        int count = 1;
            for (int i = 1; i <= n; i++) {
                count = count * i;
                sum += count;
            }
        System.out.println(n + "的阶乘和= "+sum);
    }
}
